#include<bits/stdc++.h>

using namespace std;
typedef long long ll;
const int maxn = 100000;
ll a[maxn], k;
int n;

int main() {//O(n^2)
    cin >> n;
    for (int i = 0; i < n; i++)cin >> a[i];
    cin >> k;
    sort(a, a + n);
    for (int i = 0; i < n; i++) {
        for (int j = i + 1; j < n; j++) {
            if (a[i] + a[j] == k) {
                cout << a[i] << " " << a[j] << endl;
                return 0;
            }
        }
    }
    cout << "No" << endl;


    return 0;
}